import request from '@/utils/request'
import type { PageDto, PageReqDto } from '../types'
import type { StaffIdcardWhiteItem } from './types'

export function getStaffIdcardWhitelist(params: PageReqDto & {
    name: string
    idCard: string
}): Promise<{ rows: StaffIdcardWhiteItem[] }> {
    return request.get('/crm-prod/system/library/list', {
        params
    })
}

export function deleteStaffIdcardWhiteitem(data: {
    idCard: string
}): Promise<void> {
    return request.delete('/crm-prod/system/library', {
        data
    })
}

export function addStaffIdcardWhiteitem(data: {
    idCard: string
    name: string
}): Promise<void> {
    return request.post('/crm-prod/system/library', data)
}

export function editStaffIdcardWhiteitem(data: {
    idCard: string
    name: string
}): Promise<void> {
    return request.put('/crm-prod/system/library', data)
}